package com.liuchuanzheng.lcz_study_demo.room

import androidx.room.*

/**
 * @author 刘传政
 * @date 2021/8/18 10:31
 * QQ:1052374416
 * 电话:18501231486
 * 作用:
 * 注意事项:
 */
@Dao
interface UserDao {
    @Query("select * from tb_user_info where id = :id")
    fun getUserById(id:Long):User
    @Query("select * from tb_user_info")
    fun getUsers():List<User>
    @Insert(onConflict = OnConflictStrategy.REPLACE)
    fun addUser(user: User)
    @Delete
    fun deleteByUser(user: User):Int
    @Update
    fun updateUserByUser(user: User):Int
    @Query("delete from tb_user_info")
    fun deleteAll():Int
}